<!DOCTYPE html>
<html>
<head>
<title>组管理</title>
<#include "/modules/sys/header.ftl">
</head>
<body>
<div id="rrapp" v-cloak>
	<div v-show="showList">
		<div class="grid-btn">
			<div class="form-group col-sm-2">
				<input class="form-control" v-model="q.name" @keyup.enter="query" placeholder="请输入组名称">
			</div>
			<button class="layui-btn" id="searchSubmit" @click="query"><i class="layui-icon">&#xe615;</i>查 询</button>
			<@shiro.hasPermission name = "sys:group:update">
				<button class="layui-btn" @click="add" type="button"><i class="layui-icon">&#xe61f;</i> 新 增</button>
			</@shiro.hasPermission>
			<@shiro.hasPermission name = "sys:group:update">
				<button class="layui-btn layui-btn-normal" type="button" @click="update"><i class="layui-icon">&#xe642;</i>编辑</button>
			</@shiro.hasPermission>
			<@shiro.hasPermission name = "sys:group:delete">
				<button class="layui-btn layui-btn-danger" type="button" @click="del"><i class="layui-icon">&#xe69c;</i>禁用</button>
			</@shiro.hasPermission>
			<@shiro.hasPermission name = "sys:group:enabled">
			<button class="layui-btn" type="button" @click="enabled"><i class="layui-icon">&#xe6af;</i>启用</button>
			</@shiro.hasPermission>
		</div>
	    <table id="jqGrid"></table>
	    <div id="jqGridPager"></div>
    </div>
    
    <div v-show="!showList" class="panel panel-default">
		<div class="panel-heading">{{title}}</div>
		<form class="form-horizontal" style="width:100%;max-height: 500px;overflow: auto;">
			<div class="row">
                <div class="col-sm-3" style="border-right:1px solid #e4e4e4">
                    <h5 style="font-size: 18px;padding-bottom:10px;">基本信息</h5>
                    <div class="form-group">
                        <div class="col-sm-2 control-label">组名称</div>
                        <div class="col-sm-10">
                            <input  class="form-control" v-model="group.name" placeholder="组名称"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-2 control-label">描述</div>
                        <div class="col-sm-10">
                            <input  class="form-control" v-model="group.groupDesc" placeholder="描述"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-2 control-label">代码</div>
                        <div class="col-sm-10">
                            <input  class="form-control" v-model="group.flowCode" placeholder="代码"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-2 control-label">状态</div>
                        <label class="radio-inline">
                            <input type="radio" name="deleteStatus" value="1" v-model="group.deleteStatus"/> 禁用
                        </label>
                        <label class="radio-inline">
                            <input type="radio" name="deleteStatus" value="0" v-model="group.deleteStatus"/> 正常
                        </label>
                    </div>
                    <#--<div class="form-group">-->
                        <#--<div class="col-sm-2 control-label">角色</div>-->
                        <#--<div class="col-sm-10">-->
                            <#--<label v-for="role in roleList" class="checkbox-inline">-->
                                <#--<input type="checkbox" :value="role.id" v-model="group.roleIdList">{{role.name}}-->
                            <#--</label>-->
                        <#--</div>-->
                    <#--</div>-->
                </div>
                <div class="col-sm-4" style="border-right:1px solid #e4e4e4">
                    <h5 style="font-size: 18px;padding-bottom:10px;">业务系统关联</h5>
				<#--<div class="col-sm-4 control-label">业务系统关联:</div>-->
				<#--<div class="row" style="padding-top: 0">-->
				<#--<div class="form-group col-md-6 ">-->
				<#--<div class="col-sm-6 control-label">业务系统授权:</div>-->
				<#--<div class="col-sm-6">-->
				<#--<ul id="menuTree" class="ztree"></ul>-->
				<#--</div>-->
				<#--</div>-->
                    <div class="form-group" style="max-height: 300px;">
                        <div class="col-sm-12">
                            <ul id="operationTree" class="ztree"></ul>
                        </div>
                    </div>
				<#--</div>-->
                </div>
                <div class="col-sm-5">
				<#--右侧组列表-->
                    <h5 style="font-size: 18px;padding-bottom:14px;">组内用户</h5>
				<#--<div class="col-sm-2 control-label">组内用户:</div>-->
                    <div class="form-group">
                        <@shiro.hasPermission name="sys:group:update">
                        <button class="layui-btn layui-btn-small" type="button" @click="addGroupUser" >增加</button>
                        </@shiro.hasPermission>
                        <button class="layui-btn layui-btn-warm layui-btn-small" type="button" @click="deleteGroupUser" style="margin-left: 30px">删除</button>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-12">
                            <table id="groupUser"></table>
                            <div id="groupUserPager"></div>
                        </div>
                    </div>
                </div>
			</div>

			<div class="row">
                <div class="form-group" style="margin-left: 30%;margin-top: 30px;">
				<@shiro.hasPermission name="sys:group:update">
				<button class="layui-btn" type="button" @click="saveOrUpdate" >确定</button>
				</@shiro.hasPermission>
                    <button class="layui-btn layui-btn-warm" type="button" @click="reload" style="margin-left: 30px">返回</button>
                </div>
			</div>

		</form>
	</div>
    <div id="updateGroupUser" style="display: none">
        <div class="form-group col-sm-2">
            <input class="form-control" v-model="q.userName" @keyup.enter="queryGroupUser" placeholder="请输入姓名">
        </div>
        <button class="layui-btn" id="searchUserSubmit" @click="queryGroupUser"><i class="layui-icon">&#xe615;</i>查 询</button>
        <div class="form-group col-sm-12">
            <table id="groupUser_table"></table>
            <div id="groupUser_pager"></div>
        </div>
    </div>

</div>
   
<script src="${siteurl}/js/sys/group.js?_${.now?long?c}"></script>
</body>
</html>